<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function shallowCopy(object) {

            if (!object || typeof object !== "object") return;
            let newObj = Array.isArray(object) ? [] : {}
            for (let key in object) {
                if (object.hasOwnProperty(key)) {
                    newObj[key] = object[key]
                }
            }
            return newObj;
        }
    </script>
</body>

</html>